Skip to main content

Grid Class

Description:

  A class for creating Grid objects.

__call

Type: Metamethod.

Description:

  Creates a new Grid with the specified texture rectangle and grid size.

Signature:

metamethod __call: function(self: GridClass, width: number, height: number, gridX: integer, gridY: integer): Grid

Parameters:

ParameterTypeDescription
widthnumberThe width of the grid.
heightnumberThe height of the grid.
gridXintegerThe number of columns in the grid.
gridYintegerThe number of rows in the grid.

Returns:

Return TypeDescription
GridThe new Grid instance.

__call

Type: Metamethod.

Description:

  Creates a new Grid with the specified texture, texture rectangle, and grid size.

Signature:

metamethod __call: function(self: GridClass, texture: Texture2D, textureRect: Rect, gridX: integer, gridY: integer): Grid

Parameters:

ParameterTypeDescription
textureTexture2DThe texture to use for the grid.
textureRectRectThe rectangle within the texture to use for the grid.
gridXintegerThe number of columns in the grid.
gridYintegerThe number of rows in the grid.

Returns:

Return TypeDescription
GridThe new Grid instance.

__call

Type: Metamethod.

Description:

  Creates a new Grid with the specified texture and grid size.

Signature:

metamethod __call: function(self: GridClass, texture: Texture2D, gridX: integer, gridY: integer): Grid

Parameters:

ParameterTypeDescription
textureTexture2DThe texture to use for the grid.
gridXintegerThe number of columns in the grid.
gridYintegerThe number of rows in the grid.

Returns:

Return TypeDescription
GridThe new Grid instance.

__call

Type: Metamethod.

Description:

  Creates a new Grid with the specified clip string and grid size.

Signature:

metamethod __call: function(self: GridClass, clipStr: string, gridX: integer, gridY: integer): Grid

Parameters:

ParameterTypeDescription
clipStrstringThe clip string to use for the grid.Can be "Image/file.png" and "Image/items.clip
gridXintegerThe number of columns in the grid.
gridYintegerThe number of rows in the grid.

Returns:

Return TypeDescription
GridThe new Grid instance.